<?php
/*------------------------------------------------------------------------
# company - company management
# @author    pipapai.com
-------------------------------------------------------------------------*/

defined('_JEXEC') or die;
// disable core styles to avoid bs conflict
OC_Util::$core_styles = array();

if(isDevMode()) {
   OCP\Util::addStyle('company', 'company');
   OCP\Util::addScript('company', 'logo');
} else {
   OCP\Util::addStyle('static', 'company');
   OCP\Util::addScript('static', 'apps/company.logo.min');
}

OCP\App::setActiveNavigationEntry('company_settings');

$lang = PFactory::getLanguage();
$lang->load("com_jobs", JPATH_SITE, "zh-CN");

$user = $_['user'];

?>

<script type="text/javascript" src="<?php print_unescaped(OC_Helper::linkTo('company/js', 'company.php'));?>"></script>

<?php if(isDevMode()): ?>
<link rel="stylesheet" type="text/css" href="<?php print_unescaped(OC_Helper::linkTo("", "themes/jobs/core/js/jquery/imgareaselect/imgareaselect-animated.css"));?>" />
<script type="text/javascript" src="<?php print_unescaped(OC_Helper::linkTo("", "themes/jobs/core/js/jquery/imgareaselect/jquery.imgareaselect.js"));?>"></script>
<?php else: ?>
<?php 
   OCP\Util::addStyle('static', 'imgareaselect/imgareaselect-animated');
?>
<?php endif; ?>

<div class="hr_inner_navigate clearfix">
   <ul class="clearfix">
      <?php PCompanyHelper::showNavigationMenu($_['masteruser'], 'logo');?>
   </ul>
</div>

<div class="hr_company_set span9 leftpad">
   <div class="logoform">
      <div class="tips normal">公司LOGO是您企业形象的象征，请点击下面的按钮上传。<br/><span>(支持最大4Ｍ的JPG,PNG格式的图像文件上传)</span></div>
      <div class="clearfix">
      	<div class="hr_uplogoleft pull-left">
            <!-- 初始状态的时候 -->
         	<div class="clearfix">
               <div class="logoimgselect">
                  <div id="imagecontainer" class="imagecontainer" style="margin:0 auto;width:100%; position:relative;">
                     <img style="display:none" src="/images/blank.png"/>
                  </div>

                  <div id="uploadlogoform" class="uploadform" style="width:100%; height:100%">
                     <form id="uploadform" class="logoselect file_upload" action="<?php echo OC_Helper::linkToRoute('company_uploadlogo');?>" method="POST" enctype="multipart/form-data">
                        <div class="upload_imgbtn">
                           <input class="inputfile" type="file" name="Filedata"/>
                           <div class="file_upload_label" data-nodragtext="选择文件上传">选择或拖拽文件至该区域上传</div>
                        </div>
                        <input type="hidden" name="requesttoken" value="<?php echo $_['requesttoken'] ?>" id="requesttoken">
                     </form>
                     <table class="files" width="390" border="0" cellpadding="0" cellspacing="0">
                        <tr class="file_upload_template" style="display:none;">
                           <td class="file_name"></td>
                           <td class="file_size"></td>
                           <td class="file_upload_progress"><div style="width:80px;"></div></td>
                           <td class="file_upload_start"><button class="btn btn-info">开始上传</button></td>
                        </tr>
                     </table>
                  </div>

               </div>
            </div>
         </div>

         <div class="hr_uplogoright pull-left">
         	<div class="logoshow" id="logopreview">
            	<div class="company_bigshow">
               	<h6 class="medium">拖拽或缩放选区，生成您满意的公司LOGO</h6>
                  <div class="logobig_p medium">
                     <div class="logo_big"><img src="/images/blank.png"/></div>
                     <div>180*180像素</div>
                  </div>
               </div>
               <div class="company_othershow clearfix">
                  <div class="logomiddle_p medium">
                     <div class="logo_middle"><img src="/images/blank.png"/></div>
                     <div>50*50像素</div>
                  </div>
                  <div class="logosmall_p medium">
                     <div class="logo_small"><img src="/images/blank.png"/></div>
                     <div>30*30像素</div>
                  </div>
               </div>
               <form id="thumbnailform" name="thumbnailform" action="<?php echo OC_Helper::linkToRoute('company_savelogo');?>" method="post">
                  <input type="hidden" name="imageid" value="" id="imageid" />
                  <input type="hidden" name="x1" value="" id="x1" />
                  <input type="hidden" name="y1" value="" id="y1" />
                  <input type="hidden" name="x2" value="" id="x2" />
                  <input type="hidden" name="y2" value="" id="y2" />
                  <input type="hidden" name="scalex" value="" id="scalex" />
                  <input type="hidden" name="scaley" value="" id="scaley" />
                  <input type="submit" class='btn btn-info' value="保 存" id="save_thumb" />
                  <span class="success" id="error"></span>
              </form>
            </div>
         </div>
      </div>
   </div>
</div>
